-- GENERATED SPELL FOR [Azure Binder] --


function spell0_31007(pUnit, Event) --@Arcane Barrage,n/a--
pUnit:FullCastSpellOnTarget(58456,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_31007', 599, 1)
end

function spell1_31007(pUnit, Event) --@Arcane Barrage,n/a--
pUnit:FullCastSpellOnTarget(59248,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_31007', 611, 1)
end

function spell2_31007(pUnit, Event) --@Arcane Explosion,Self--
pUnit:FullCastSpellOnTarget(58455,pUnit)
pUnit:RegisterEvent('Sorts_31007', 638, 1)
end

function spell3_31007(pUnit, Event) --@Arcane Explosion,Self--
pUnit:FullCastSpellOnTarget(59245,pUnit)
pUnit:RegisterEvent('Sorts_31007', 671, 1)
end

function Sorts_31007(pUnit, Event)
local choix_sorts_31007 = math.random(0, 3)
if choix_sorts_31007 == 0 then
pUnit:RegisterEvent('spell0_31007', 1, 1)
end
if choix_sorts_31007 == 1 then
pUnit:RegisterEvent('spell1_31007', 1, 1)
end
if choix_sorts_31007 == 2 then
pUnit:RegisterEvent('spell2_31007', 1, 1)
end
if choix_sorts_31007 == 3 then
pUnit:RegisterEvent('spell3_31007', 1, 1)
end
end

function mob31007_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_31007', math.random(1500, 3000), 1)
end

function mob31007_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob31007_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob31007_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(31007, 1, 'mob31007_Action')
RegisterUnitEvent(31007, 2, 'mob31007_Leave')
RegisterUnitEvent(31007, 3, 'mob31007_Kill')
RegisterUnitEvent(31007, 4, 'mob31007_Die')
